/***************************************************************
 * Name:      laba2Main.h
 * Purpose:   Defines Application Frame
 * Author:    Oleksandr Maksymenko (maksymenko.o.v@nmu.one)
 * Created:   2022-12-02
 * Copyright: Oleksandr Maksymenko ()
 * License:
 **************************************************************/

#ifndef LABA2MAIN_H
#define LABA2MAIN_H

#include "wxGridView.h"
#include "wxPaintView.h"
#include "wxGenerateDialog.h"
#include "wxPoints.h"
#include <wx/wfstream.h>
#include <wx/textfile.h>
#include <random>

//(*Headers(laba2Frame)
#include <wx/frame.h>
#include <wx/menu.h>
#include <wx/statusbr.h>
//*)

class laba2Frame: public wxFrame
{
    public:

        laba2Frame(wxWindow* parent,wxWindowID id = -1);
        virtual ~laba2Frame();

    private:
        void fileToPoints(wxTextFile *file, wxPoints *points);
        void pointsToFile(wxPoints *points, wxTextFile *file);

        void CreateView(int viewId);
        void DestroyView(int viewId);
        void SwitchView(int viewId);

        wxGridView *gridView;
        wxPaintView *paintView;
        wxPoints *points;
        wxString tmpFilename;
        int currentViewId;

        //(*Handlers(laba2Frame)
        void OnQuit(wxCommandEvent& event);
        void OnAbout(wxCommandEvent& event);
        void OnOpenMenuItem(wxCommandEvent& event);
        void OnGenerateMenuItem(wxCommandEvent& event);
        void OnSaveAs(wxCommandEvent& event);
        void OnSaveAsMenuItem(wxCommandEvent& event);
        void OnCloseMenuItem(wxCommandEvent& event);
        void OnTableDataSelected(wxCommandEvent& event);
        void OnGraphicDataSelected(wxCommandEvent& event);
        void OnExportMenuItem(wxCommandEvent& event);
        //*)

        //(*Identifiers(laba2Frame)
        static const long idMenuOpen;
        static const long idMenuSaveAs;
        static const long idMenuClose;
        static const long idMenuExport;
        static const long idMenuQuit;
        static const long idMenuTableData;
        static const long idMenuGraphicData;
        static const long idMenuGenerate;
        static const long idMenuAbout;
        static const long ID_STATUSBAR1;
        //*)

        //(*Declarations(laba2Frame)
        wxMenu* Menu3;
        wxMenu* Menu4;
        wxMenuItem* MenuItem3;
        wxMenuItem* MenuItem4;
        wxMenuItem* MenuItem5;
        wxMenuItem* MenuItem6;
        wxMenuItem* MenuItem7;
        wxMenuItem* MenuItem8;
        wxMenuItem* MenuItem9;
        wxStatusBar* StatusBar1;
        //*)

        DECLARE_EVENT_TABLE()
};

#endif // LABA2MAIN_H
